public class ExtendTest3{
    public static void main(String[] args){
        
        Sup test = new Sub();
        System.out.println("name: " + test.name);
        test.showName();
        test.showName2();
        test.getS("hah");
        System.out.println("show s: " + test.s);
        
        System.out.println("name: " + ((Sub)test).name);
        ((Sub)test).showName();
        ((Sub)test).showName2();
        ((Sub)test).getS("hah");
        System.out.println("show s: " + ((Sub)test).s);
        
        System.out.println("\n**********\n");
        
        Sub test3 = new Sub();
        test3.showName();
        test3.showName2();
    }
}

class Sup{
    String name = "father";
    String s;
    public void showName(){
        System.out.println("show name: " + name);
    }
    public void showName2(){
        System.out.println("show name2: " + name);
    }
    public void getS(String n){
        s = n;
    }
}

class Sub extends Sup{
    String name = "son";
    String s;
    public void showName(){
        System.out.println("show name: " + name);
    }
    // public void getS(String n){
    //     s = n;
    // }
}